package com.ruoyi.web.controller.lingshui.integrityInformationAdd;


import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import com.ruoyi.common.config.Global;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.exception.LSBusinessException;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.framework.util.ShiroUtils;
import com.ruoyi.supervise.domain.BaseProjectInfo;
import com.ruoyi.supervise.domain.Enterprise;
import com.ruoyi.supervise.domain.IGMAuditRecord;
import com.ruoyi.supervise.domain.IGMBehavioStandard;
import com.ruoyi.supervise.domain.IGMIntegrityApplyInfo;
import com.ruoyi.supervise.domain.IGMPersonalPoorInfo;
import com.ruoyi.supervise.domain.IGMPersonalWellInfo;
import com.ruoyi.supervise.domain.PersonInfo;
import com.ruoyi.supervise.domain.PersonalPoorInfoEntity;
import com.ruoyi.supervise.domain.PersonalWellInfoEntity;
import com.ruoyi.supervise.domain.ProjectArchives;
import com.ruoyi.supervise.domain.StandardEntity;
import com.ruoyi.supervise.service.IEnterpriseService;
import com.ruoyi.supervise.service.IIntegrityInformationAddService;
import com.ruoyi.supervise.service.IPersonInfoService;
import com.ruoyi.supervise.service.IProjectArchivesBaseInfoService;
import com.ruoyi.supervise.service.IProjectArchivesService;
import com.ruoyi.system.domain.SysUser;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;

/**
 * @ClassName: TbFocusProjectController
 * @Description: 关注项目controller
 * @Author wtj
 * @DateTime 2020年5月14日 下午2:22:19
 */
@Controller
@RequestMapping("/integrityInformationAdd/peopleBehavior")
public class PeopleController extends BaseController{

	private String peopleGoodBehaviorPrefix = "lingshui/integrityInformationAdd/peopleBehavior/good";
	private String peopleBadBehaviorPrefix = "lingshui/integrityInformationAdd/peopleBehavior/bad";
	private String selectPrefix = "lingshui/integrityInformationAdd/select";
	
	@Autowired
	private IIntegrityInformationAddService integrityInformationAddService;
	
	@Autowired
	private IPersonInfoService personInfoService;
	
	@Autowired
    private IEnterpriseService enterpriseService;
	
	@Autowired
    private IProjectArchivesService projectArchivesService;
	
	@Autowired
    private IProjectArchivesBaseInfoService projectArchivesBaseInfoService;

	/**
	 * @Title: peopleGood
	 * @Description: 跳转到人员良好行为登记列表页面
	 * @Author wtj
	 * @DateTime 2020年6月15日 上午9:44:09
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personGoodBehavior:view")
	@GetMapping("/peopleGood")
	public String peopleGood()
	{
	    return peopleGoodBehaviorPrefix + "/peopleGoodBehavior";
	}
	
	/**
	 * @Title: peopleGoodBehaviorList
	 * @Description: 获取人员良好行为登记列表页面数据
	 * @Author wtj
	 * @DateTime 2020年6月16日 下午3:23:03
	 * @param igmai
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personGoodBehavior:list")
	@PostMapping("/peopleGoodBehaviorList")
    @ResponseBody
    public TableDataInfo peopleGoodBehaviorList(IGMIntegrityApplyInfo igmai)
    {
		startPage();
	    List<IGMIntegrityApplyInfo> igmaiList = integrityInformationAddService.selectPeopleGoodIGMIntegrityApplyInfoList(igmai);
	    return getDataTable(igmaiList);
    }
	
	/**
	 * @Title: peopleGoodBehaviorAdd
	 * @Description: 跳转到人员良好行为登记添加页面
	 * @Author wtj
	 * @DateTime 2020年6月16日 下午3:23:23
	 * @param mmap
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personGoodBehavior:add")
	@GetMapping("/peopleGoodBehaviorAdd")
    public String peopleGoodBehaviorAdd(ModelMap mmap)
    {
		SysUser currentUser = ShiroUtils.getSysUser();
		mmap.put("RegPerson", currentUser.getUserName());
		mmap.put("OwnerGuid", currentUser.getLoginName());
		mmap.put("RegDepartment", currentUser.getDept().getDeptName());
		mmap.put("RegDepartmentGuid", currentUser.getDeptId());
        return peopleGoodBehaviorPrefix + "/peopleGoodBehaviorAdd";
    }
	
	/**
	 * @Title: peopleGoodBehavioStandard
	 * @Description: 跳转到人员良好行为选择页面
	 * @Author wtj
	 * @DateTime 2020年6月15日 下午3:07:08
	 * @param identifyType
	 * @param mmap
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personGoodBehavior:selectview")
	@GetMapping("/peopleGoodBehavioStandard/{identifyType}/{idcard}")
    public String peopleGoodBehavioStandard(@PathVariable("identifyType") String identifyType,@PathVariable("idcard") String idcard,ModelMap mmap)
    {
		List<String> strList = integrityInformationAddService.selectIGMIntegrityApplyInfoPunishObject(identifyType);
		if(!idcard.equals("0")) {
			List<String> quaList = integrityInformationAddService.selectIGMPersonalWellInfoByDateadd(idcard);
			List<String> quaListNew = CollUtil.distinct(quaList);
			List<String> list = new ArrayList<String>(CollUtil.disjunction(strList, quaListNew));
			strList = list;
		}
		mmap.put("strList", strList);
		mmap.put("title", "人员良好行为");
		mmap.put("urlPrefix", "integrityInformationAdd/peopleBehavior");
		return selectPrefix + "/behavioStandard";
    }
	
	/**
	 * @Title: behavioStandardList
	 * @Description: 获取行为选择页面数据
	 * @Author wtj
	 * @DateTime 2020年6月15日 下午3:08:09
	 * @param identifyType
	 * @param punishObject
	 * @param igmbs
	 * @return
	 */
	@RequiresPermissions(value={"integrityInformationAdd:personGoodBehavior:selectlist", "integrityInformationAdd:personBadBehavior:selectlist"}, logical=Logical.OR)
	@PostMapping("/behavioStandardList/{identifyType}/{punishObject}")
    @ResponseBody
    public TableDataInfo behavioStandardList(@PathVariable("identifyType") String identifyType,@PathVariable("punishObject") String punishObject,IGMBehavioStandard igmbs)
    {
		startPage();
	    igmbs.setIdentifyType(identifyType);
	    igmbs.setPunishObject(punishObject);
	    List<IGMBehavioStandard> igmbsList = integrityInformationAddService.selectIGMBehavioStandardList(igmbs);
	    return getDataTable(igmbsList);
    }
	
	/**
	 * @Title: selectPeopleTable
	 * @Description: 跳转到人员选择页面
	 * @Author wtj
	 * @DateTime 2020年6月15日 下午3:23:23
	 * @return
	 */
	@RequiresPermissions("person:personall:view")
	@GetMapping("/selectPeopleTable")
    public String selectPeopleTable()
    {
		return selectPrefix+"/selectPeopleTable";
    }
	
	/**
	 * @Title: selectEnterTableList
	 * @Description: 获取人员选择页面数据
	 * @Author wtj
	 * @DateTime 2020年6月15日 下午3:23:39
	 * @param enter
	 * @return
	 */
	@RequiresPermissions("person:personall:list")
	@PostMapping("/selectPeopleTableList")
    @ResponseBody
    public TableDataInfo selectPeopleTableList(PersonInfo personInfo)
    {
		startPage();
		List<PersonInfo> personInfoList = personInfoService.selectPersonInfoList(personInfo);
		return getDataTable(personInfoList);
    }
	
	/**
	 * @Title: selectProjectTable
	 * @Description: 跳转到项目选择页面
	 * @Author wtj
	 * @DateTime 2020年6月15日 下午3:31:00
	 * @return
	 */
	@RequiresPermissions("project:projectAll:view")
	@GetMapping("/selectProjectTable")
    public String selectProjectTable()
    {
		return selectPrefix + "/selectProjectTable";
    }
	
	/**
	 * @Title: selectProjectTableList
	 * @Description: 获取项目选择页面的数据
	 * @Author wtj
	 * @DateTime 2020年6月15日 下午3:32:10
	 * @param projectArchives
	 * @return
	 */
	@RequiresPermissions("project:projectAll:lists")
	@PostMapping("/selectProjectTableList")
    @ResponseBody
    public TableDataInfo selectProjectTableList(ProjectArchives projectArchives)
    {
		startPage();
		List<ProjectArchives> projectArchivesList = projectArchivesService.selectProjectArchivesList(projectArchives);
		return getDataTable(projectArchivesList);
    }
	
	/**
	 * @Title: selectEnterTable
	 * @Description: 跳转到企业选择页面
	 * @Author wtj
	 * @DateTime 2020年6月15日 下午3:32:51
	 * @return
	 */
	@RequiresPermissions("enterprise:enterpriseAll:view")
	@GetMapping("/selectEnterTable")
    public String selectEnterTable()
    {
		return selectPrefix + "/selectEnterTable";
    }
	
	/**
	 * @Title: selectEnterTableList
	 * @Description: 获取企业选择页面数据
	 * @Author wtj
	 * @DateTime 2020年6月15日 下午3:33:15
	 * @param enter
	 * @return
	 */
	@RequiresPermissions("enterprise:enterpriseAll:list")
	@PostMapping("/selectEnterTableList")
    @ResponseBody
    public TableDataInfo selectEnterTableList(Enterprise enter)
    {
		startPage();
		List<Enterprise> enterList = integrityInformationAddService.enterTableList(enter);
		return getDataTable(enterList);
    }
	
	/**
	 * @Title: addPeopleBehavioField
	 * @Description: 选择好行为的接口
	 * @Author wtj
	 * @DateTime 2020年6月16日 下午3:22:19
	 * @param behaviorCode
	 * @param personGuid
	 * @param goodOrBad
	 * @return
	 */
	@RequiresPermissions(value={"integrityInformationAdd:personGoodBehavior:selectlist", "integrityInformationAdd:personBadBehavior:selectlist"}, logical=Logical.OR)
	@PostMapping("/addPeopleBehavioField")
    @ResponseBody
    public AjaxResult addPeopleBehavioField(@RequestParam("behaviorCode") String behaviorCode,@RequestParam("personGuid") String personGuid,@RequestParam("idcard") String idcard,@RequestParam("goodOrBad") String goodOrBad)
    {
		Map<String,Object> strMap = new HashMap<String,Object>();
		IGMBehavioStandard igmbs = integrityInformationAddService.selectIGMBehavioStandardByGuid(behaviorCode);
		strMap.put("BehaviorCode", igmbs.getGuid());
    	strMap.put("BehaviorCategory", igmbs.getBehaviorCategory());
    	strMap.put("BehaviorDescription", igmbs.getBehavioDescription());
    	strMap.put("MaxScores", igmbs.getMaxScores());
    	if(StrUtil.containsAny(igmbs.getPenaltyScores(), ",")) {
    		String[] scoreList=StrUtil.split(igmbs.getPenaltyScores(), ",");
    		strMap.put("Score", scoreList);
    	}else {
    		strMap.put("Score", igmbs.getPenaltyScores());
    	}
    	if(!StringUtils.isEmpty(personGuid)) {
    		String pointsAdded = "0";
    		if("good".equals(goodOrBad)) {
    			IGMPersonalWellInfo igmpwi = new IGMPersonalWellInfo();
    			igmpwi.setBehaviorCode(behaviorCode);
    			igmpwi.setPersonGuid(personGuid);
    			igmpwi.setIDCard(idcard);
    			igmpwi.setLNPublishEndDate(DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MS_PATTERN));
    			pointsAdded = integrityInformationAddService.sumPeopleGoodAddedScores(igmpwi);
    		}else if("bad".equals(goodOrBad)) {
    			IGMPersonalPoorInfo igmppi = new IGMPersonalPoorInfo();
    			igmppi.setBehaviorCode(behaviorCode);
    			igmppi.setCertNumber(idcard);
    			igmppi.setPersonGuid(personGuid);
    			igmppi.setPublishEndDate(DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MS_PATTERN));
    			pointsAdded = integrityInformationAddService.sumPeopleBadAddedScores(igmppi);
    		}
    		if(StringUtils.isEmpty(pointsAdded)) {
    			pointsAdded = "0";
    		}
    		strMap.put("pointsAdded", pointsAdded);
    	}else {
    		strMap.put("pointsAdded", " ");
    	}
    	return AjaxResult.success(strMap);
    }
	
	/**
	 * @Title: addPeopleField
	 * @Description: 选择好人员的接口
	 * @Author wtj
	 * @DateTime 2020年6月15日 下午5:51:07
	 * @param behaviorCode
	 * @param personGuid
	 * @param goodOrBad
	 * @return
	 */
	@RequiresPermissions("person:personall:list")
	@PostMapping("/addPeopleField")
    @ResponseBody
    public AjaxResult addPeopleField(@RequestParam("behaviorCode") String behaviorCode,@RequestParam("personGuid") String personGuid,@RequestParam("idcard") String idcard,@RequestParam("goodOrBad") String goodOrBad)
    {
		Map<String,Object> strMap = new HashMap<String,Object>();
		PersonInfo pi = personInfoService.selectPersonInfoByGuid(personGuid);
		strMap.put("PersonName", pi.getName());
    	strMap.put("PersonGuid", pi.getGuid());
    	strMap.put("IDCardTypeNum", pi.getIDCardTypeNum());
    	strMap.put("IDCard", pi.getIDCard());
    	if(!StringUtils.isEmpty(behaviorCode)) {
    		IGMBehavioStandard igmbs = integrityInformationAddService.selectIGMBehavioStandardByGuid(behaviorCode);
    		String pointsAdded = "0";
    		boolean isUndo = false;
    		if("good".equals(goodOrBad)) {
    			IGMPersonalWellInfo igmpwi = new IGMPersonalWellInfo();
    			igmpwi.setBehaviorCode(behaviorCode);
    			igmpwi.setPersonGuid(personGuid);
    			igmpwi.setIDCard(idcard);
    			igmpwi.setLNPublishEndDate(DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MS_PATTERN));
    			pointsAdded = integrityInformationAddService.sumPeopleGoodAddedScores(igmpwi);
    			isUndo = integrityInformationAddService.judgeQualificationsUndoPeopleWell(idcard, igmbs.getPunishObject());
    		}else if("bad".equals(goodOrBad)) {
    			IGMPersonalPoorInfo igmppi = new IGMPersonalPoorInfo();
    			igmppi.setBehaviorCode(behaviorCode);
    			igmppi.setCertNumber(idcard);
    			igmppi.setPersonGuid(personGuid);
    			igmppi.setPublishEndDate(DateUtil.format(new Date(), DatePattern.NORM_DATETIME_MS_PATTERN));
    			pointsAdded = integrityInformationAddService.sumPeopleBadAddedScores(igmppi);
    			isUndo = integrityInformationAddService.judgeQualificationsUndoPeoplePoor(idcard, igmbs.getPunishObject());
    		}
    		if(StringUtils.isEmpty(pointsAdded)) {
    			pointsAdded = "0";
    		}
    		strMap.put("pointsAdded", pointsAdded);
    		strMap.put("isUndo", isUndo);
    	}else {
    		strMap.put("pointsAdded", " ");
    	}
    	return AjaxResult.success(strMap);
    }
	
	/**
	 * @Title: addProjectField
	 * @Description: 选择好工程的接口
	 * @Author wtj
	 * @DateTime 2020年6月16日 下午3:21:34
	 * @param projectGuid
	 * @return
	 */
	@RequiresPermissions("project:projectAll:lists")
	@PostMapping("/addProjectField")
    @ResponseBody
    public AjaxResult addProjectField(@RequestParam("projectGuid") String projectGuid)
    {
		BaseProjectInfo projectArchivesBaseInfo = new BaseProjectInfo();
    	projectArchivesBaseInfo.setGuid(projectGuid);
 	    BaseProjectInfo pabi=projectArchivesBaseInfoService.selectProjectArchivesBaseInfoByGuid(projectArchivesBaseInfo);
    	Map<String,Object> strMap = new HashMap<String,Object>();
    	strMap.put("EngineeringGuid", pabi.getGuid());
    	strMap.put("EngineeringName", pabi.getProjectName());
    	return AjaxResult.success(strMap);
    }
	
	/**
	 * @Title: addEnterField
	 * @Description: 选择好企业的接口
	 * @Author wtj
	 * @DateTime 2020年6月16日 下午3:21:54
	 * @param companyGuid
	 * @return
	 */
	@RequiresPermissions("enterprise:enterpriseAll:list")
	@PostMapping("/addEnterField")
    @ResponseBody
    public AjaxResult addEnterField(@RequestParam("companyGuid") String companyGuid)
    {
		Map<String,Object> strMap = new HashMap<String,Object>();
		Enterprise enter = enterpriseService.selectEnterpriseInfoByGuid(companyGuid);
    	strMap.put("CompanyName", enter.getCompanyName());
    	strMap.put("OrginGuid", enter.getOrganCode());
    	strMap.put("CompanyGuid", enter.getGuid());
    	return AjaxResult.success(strMap);
    }
	
	/**
	 * @Title: personsGoodBehaviorSaveAndReport
	 * @Description: 人员良好行为添加保存接口
	 * @Author wtj
	 * @DateTime 2020年6月16日 上午9:45:38
	 * @param pwie
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personGoodBehavior:add")
	@PostMapping("/personsGoodBehaviorSaveAndReport")
    @ResponseBody
    public AjaxResult personsGoodBehaviorSaveAndReport(@Validated PersonalWellInfoEntity pwie,String MaxScores)
    {
		return toAjax(integrityInformationAddService.personGoodBehaviorSaveAndReport(pwie,MaxScores));
    }
	
	/**
	 * @Title: addFileInsertGood
	 * @Description: 人员良好行为添加保存接口（该接口包含文件上传）
	 * @Author wtj
	 * @DateTime 2020年6月16日 上午10:21:31
	 * @param addFile
	 * @param pwie
	 * @return
	 * @throws IOException
	 */
	@RequiresPermissions("integrityInformationAdd:personGoodBehavior:add")
	@PostMapping("/addFileInsertGood")
    @ResponseBody
    public AjaxResult addFileInsertGood(@RequestParam("addFileInsertGood") MultipartFile addFile,PersonalWellInfoEntity pwie,String MaxScores) throws IOException
    {
		// 上传文件路径
    	String filePath = Global.getLSUploadPath();
    	// 上传并返回新文件名称
    	String fileName = FileUploadUtils.upload(filePath, addFile);
    	pwie.setMaterials("|"+fileName+"|"+"人员良好行为记录相关材料_"+pwie.getPersonName()+"_"+pwie.getBehaviorCode()+"."+FileUploadUtils.getExtension(addFile)+"|"+addFile.getSize());
    	pwie.setFileNameOld("人员良好行为记录相关材料_"+pwie.getPersonName()+"_"+pwie.getBehaviorCode()+"."+FileUploadUtils.getExtension(addFile));
    	return toAjax(integrityInformationAddService.personGoodBehaviorSaveAndReport(pwie,MaxScores));
    }
	
	/**
	 * @Title: resourceDownload
	 * @Description: 文件下载
	 * @Author wtj
	 * @DateTime 2020年6月16日 上午10:21:55
	 * @param resource
	 * @param fileName
	 * @param request
	 * @param response
	 * @throws Exception
	 */
	@RequiresPermissions("integrityInformationAdd:personGoodBehavior:view")
	@GetMapping("/download")
    public void resourceDownload(String resource,String fileName, HttpServletRequest request, HttpServletResponse response)
            throws Exception
    {
        // 本地资源路径
        //String localPath = Global.getProfile();
    	String localPath = Global.getUploadPath();
        // 数据库资源地址
        String downloadPath = localPath + StringUtils.substringAfter(resource, Constants.RESOURCE_PREFIX);
        // 下载名称
        String downloadName = fileName;
        response.setCharacterEncoding("utf-8");
        response.setContentType("multipart/form-data");
        response.setHeader("Content-Disposition",
                "attachment;fileName=" + FileUtils.setFileDownloadHeader(request, downloadName));
        try{
        	FileUtils.writeBytes(downloadPath, response.getOutputStream());
        }catch(Exception ex)
        {
        	throw new LSBusinessException("下载出错，可能是文件不存在，请联系管理员");
        }
    }
	
	/**
	 * @Title: editPeopleGoodBehavior
	 * @Description: 跳转到人员良好行为登记编辑页面接口
	 * @Author wtj
	 * @DateTime 2020年6月16日 上午10:22:08
	 * @param guid
	 * @param mmap
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personGoodBehavior:wsbeditxw")
	@GetMapping("/editPeopleGoodBehavior/{guid}")
    public String editPeopleGoodBehavior(@PathVariable("guid") String guid,ModelMap mmap)
    {
		IGMIntegrityApplyInfo applyInfo = integrityInformationAddService.selectIGMIntegrityApplyInfoByGuid(guid);
		if(applyInfo == null) {
			throw new LSBusinessException("数据获取不正确，请确认选择的是否正确");
		}
		mmap.put("applyInfo", applyInfo);
    	StandardEntity se = integrityInformationAddService.selectStandardEntityByGuid(applyInfo.getPersonalWellInfoEntity().getBehaviorCode());
    	applyInfo.getPersonalWellInfoEntity().setStandard(se);
    	if(StrUtil.containsAny(applyInfo.getPersonalWellInfoEntity().getStandard().getPenaltyScores(), ",")) {
    		String[] subStr=StrUtil.split(applyInfo.getPersonalWellInfoEntity().getStandard().getPenaltyScores(), ",");
    		mmap.put("subStr", subStr);
    	}
    	mmap.put("personalWellInfoEntity", applyInfo.getPersonalWellInfoEntity());
    	
    	if(StringUtils.isEmpty(se.getMaxScores()) || se.getMaxScores().equals("0") || se.getMaxScores().equals("0.0")) {
    		se.setMaxScores("无上限");
    	}
    	mmap.put("StandardEntity", se);
    	if(StrUtil.split(applyInfo.getPersonalWellInfoEntity().getMaterials(), "|").length == 4) {
    		mmap.put("FileNameOld", StrUtil.split(applyInfo.getPersonalWellInfoEntity().getMaterials(), "|")[2]);
    		String filePath = StrUtil.split(applyInfo.getPersonalWellInfoEntity().getMaterials(), "|")[1];
        	String[] file = StrUtil.split(filePath, "/");
        	//判断是否属于陵水系统上传的文件
        	if(file.length >= 3) {
        		if("profile".equals(file[1]) && "lingshui".equals(file[2]) && StrUtil.containsAny(filePath, "/profile/lingshui/")) {
            		mmap.put("fileState", "1");
            		mmap.put("filePath", filePath);
            	}else {
            		mmap.put("fileState", "2");
            		mmap.put("filePath", "");
            	}
        	}else if(StrUtil.containsAny(filePath,"\\")){
        		if(StrUtil.split(filePath, "\\").length == 4) {
        			mmap.put("fileState", "0");
            		mmap.put("filePath", Global.getConfig("ruoyi.bigPlatform") + filePath);
        		}else {
        			mmap.put("fileState", "2");
            		mmap.put("filePath", "");
        		}
        	}
    	}else {
    		mmap.put("FileNameOld", "");
    		mmap.put("fileState", "2");
    		mmap.put("filePath", "");
    	}
    	return peopleGoodBehaviorPrefix + "/peopleGoodBehaviorUpdate";
    }
	
	/**
	 * @Title: personsGoodBehaviorSaveAndReportUpdate
	 * @Description: 人员良好行为编辑保存接口(该接口不包含文件上传)
	 * @Author wtj
	 * @DateTime 2020年6月16日 上午11:22:06
	 * @param pwie
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personGoodBehavior:wsbeditxw")
	@PostMapping("/personsGoodBehaviorSaveAndReportUpdate")
    @ResponseBody
    public AjaxResult personsGoodBehaviorSaveAndReportUpdate(@Validated PersonalWellInfoEntity pwie,String MaxScores)
    {
		return toAjax(integrityInformationAddService.updatepersonsGoodBehavior(pwie, 1,MaxScores));
    }
	
	/**
	 * @Title: addFileGoodUpdate
	 * @Description: 人员良好行为编辑保存接口(该接口包含文件上传)
	 * @Author wtj
	 * @DateTime 2020年6月16日 下午3:20:28
	 * @param addFile
	 * @param pwie
	 * @return
	 * @throws IOException
	 */
	@RequiresPermissions("integrityInformationAdd:personGoodBehavior:wsbeditxw")
	@PostMapping("/addFileGoodUpdate")
    @ResponseBody
    public AjaxResult addFileGoodUpdate(@RequestParam("addFileGoodUpdate") MultipartFile addFile,PersonalWellInfoEntity pwie,String MaxScores) throws IOException
    {
		// 上传文件路径
    	String filePath = Global.getLSUploadPath();
    	// 上传并返回新文件名称
    	String fileName = FileUploadUtils.upload(filePath, addFile);
    	pwie.setMaterials("|"+fileName+"|"+"人员良好行为记录相关材料_"+pwie.getPersonName()+"_"+pwie.getBehaviorCode()+"."+FileUploadUtils.getExtension(addFile)+"|"+addFile.getSize());
    	pwie.setFileNameOld("人员良好行为记录相关材料_"+pwie.getPersonName()+"_"+pwie.getBehaviorCode()+"."+FileUploadUtils.getExtension(addFile));
    	return AjaxResult.success(integrityInformationAddService.updatepersonsGoodBehavior(pwie, 0,MaxScores));
    }
	
	/**
	 * @Title: peopleBadBehavior
	 * @Description: 跳转到人员不良行为登记列表页面
	 * @Author wtj
	 * @DateTime 2020年6月16日 下午6:11:41
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personBadBehavior:view")
	@GetMapping("/peopleBad")
	public String peopleBadBehavior()
	{
		return peopleBadBehaviorPrefix + "/peopleBadBehavior";
	}
	
	/**
	 * @Title: peopleBadBehaviorList
	 * @Description: 获取人员不良行为登记列表页面数据
	 * @Author wtj
	 * @DateTime 2020年6月16日 下午6:12:06
	 * @param igmai
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personBadBehavior:list")
	@PostMapping("/peopleBadBehaviorList")
    @ResponseBody
    public TableDataInfo peopleBadBehaviorList(IGMIntegrityApplyInfo igmai)
    {
		startPage();
		return getDataTable(integrityInformationAddService.selectPeopleBadIGMIntegrityApplyInfoList(igmai));
    }
	
	/**
	 * @Title: peopleBadBehaviorAdd
	 * @Description: 跳转到人员不良行为添加
	 * @Author wtj
	 * @DateTime 2020年6月17日 下午12:00:19
	 * @param mmap
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personBadBehavior:add")
	@GetMapping("/peopleBadBehaviorAdd")
    public String peopleBadBehaviorAdd(ModelMap mmap)
    {
		SysUser currentUser = ShiroUtils.getSysUser();
		mmap.put("RegisterName", currentUser.getUserName());
		mmap.put("LoginId", currentUser.getLoginName());
		mmap.put("RegisterDept", currentUser.getDept().getDeptName());
		mmap.put("RegisterDeptGuid", currentUser.getDeptId());
        return peopleBadBehaviorPrefix + "/peopleBadBehaviorAdd";
    }
	
	/**
	 * @Title: peopleBadBehavioStandard
	 * @Description: 跳转到人员不良行为选择页面
	 * @Author wtj
	 * @DateTime 2020年6月22日 下午4:18:14
	 * @param identifyType
	 * @param mmap
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personBadBehavior:selectview")
	@GetMapping("/peopleBadBehavioStandard/{identifyType}/{idcard}")
    public String peopleBadBehavioStandard(@PathVariable("identifyType") String identifyType,@PathVariable("idcard") String idcard,ModelMap mmap)
    {
		List<String> strList = integrityInformationAddService.selectIGMIntegrityApplyInfoPunishObject(identifyType);
		if(!idcard.equals("0")) {
			List<String> quaList = integrityInformationAddService.selectIGMPersonalPoorInfoByDateadd(idcard);
			List<String> quaListNew = CollUtil.distinct(quaList);
			List<String> list = new ArrayList<String>(CollUtil.disjunction(strList, quaListNew));
			strList = list;
		}
		mmap.put("strList", strList);
		mmap.put("title", "人员不良行为");
		mmap.put("urlPrefix", "integrityInformationAdd/peopleBehavior");
		return selectPrefix + "/behavioStandard";
    }
	
	/**
	 * @Title: personsBadBehaviorSaveAndReport
	 * @Description: 人员不良行为添加保存接口
	 * @Author wtj
	 * @DateTime 2020年6月17日 下午5:04:46
	 * @param ppie
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personBadBehavior:add")
	@PostMapping("/personsBadBehaviorSaveAndReport")
    @ResponseBody
    public AjaxResult personsBadBehaviorSaveAndReport(@Validated PersonalPoorInfoEntity ppie,String MaxScores)
    {
		return toAjax(integrityInformationAddService.personBadBehaviorSaveAndReport(ppie,MaxScores));
    }
	
	/**
	 * @Title: addFileInsertBad
	 * @Description: 人员不良行为添加保存接口(该接口包含文件上传)
	 * @Author wtj
	 * @DateTime 2020年6月22日 下午4:17:26
	 * @param addFile
	 * @param ppie
	 * @param MaxScores
	 * @return
	 * @throws IOException
	 */
	@RequiresPermissions("integrityInformationAdd:personBadBehavior:add")
	@PostMapping("/addFileInsertBad")
    @ResponseBody
    public AjaxResult addFileInsertBad(@RequestParam("addFileInsertBad") MultipartFile addFile,PersonalPoorInfoEntity ppie,String MaxScores) throws IOException
    {
		// 上传文件路径
    	String filePath = Global.getLSUploadPath();
    	// 上传并返回新文件名称
    	String fileName = FileUploadUtils.upload(filePath, addFile);
    	ppie.setMaterials("|"+fileName+"|"+"人员不良行为记录相关材料_"+ppie.getPersonName()+"_"+ppie.getBehaviorCode()+"."+FileUploadUtils.getExtension(addFile)+"|"+addFile.getSize());
    	ppie.setFileNameOld("人员不良行为记录相关材料_"+ppie.getPersonName()+"_"+ppie.getBehaviorCode()+"."+FileUploadUtils.getExtension(addFile));
    	return AjaxResult.success(integrityInformationAddService.personBadBehaviorSaveAndReport(ppie,MaxScores));
    }
	
	/**
	 * @Title: editPeopleBadBehavior
	 * @Description: 跳转到人员不良行为登记编辑页面接口
	 * @Author wtj
	 * @DateTime 2020年6月23日 上午9:46:47
	 * @param guid
	 * @param mmap
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personBadBehavior:wsbeditxw")
	@GetMapping("/editPeopleBadBehavior/{guid}")
    public String editPeopleBadBehavior(@PathVariable("guid") String guid,ModelMap mmap)
    {
		IGMIntegrityApplyInfo applyInfo = integrityInformationAddService.selectIGMIntegrityApplyInfoByGuid(guid);
		if(applyInfo == null) {
			throw new LSBusinessException("数据获取不正确，请确认选择的是否正确");
		}
		mmap.put("applyInfo", applyInfo);
    	StandardEntity se = integrityInformationAddService.selectStandardEntityByGuid(applyInfo.getPersonnalPoorInfoEntity().getBehaviorCode());
    	applyInfo.getPersonnalPoorInfoEntity().setStandard(se);
    	if(StrUtil.containsAny(applyInfo.getPersonnalPoorInfoEntity().getStandard().getPenaltyScores(), ",")) {
    		String[] subStr=StrUtil.split(applyInfo.getPersonnalPoorInfoEntity().getStandard().getPenaltyScores(), ",");
    		mmap.put("subStr", subStr);
    	}
    	mmap.put("personnalPoorInfoEntity", applyInfo.getPersonnalPoorInfoEntity());
    	if(StringUtils.isEmpty(se.getMaxScores()) || se.getMaxScores().equals("0") || se.getMaxScores().equals("0.0")) {
    		se.setMaxScores("无上限");
    	}
    	mmap.put("StandardEntity", se);
    	if(StrUtil.split(applyInfo.getPersonnalPoorInfoEntity().getMaterials(), "|").length == 4) {
    		mmap.put("FileNameOld", StrUtil.split(applyInfo.getPersonnalPoorInfoEntity().getMaterials(), "|")[2]);
    		String filePath = StrUtil.split(applyInfo.getPersonnalPoorInfoEntity().getMaterials(), "|")[1];
    		String[] file = StrUtil.split(filePath, "/");
    		//判断是否属于陵水系统上传的文件
        	if(file.length >= 3) {
        		if("profile".equals(file[1]) && "lingshui".equals(file[2]) && StrUtil.containsAny(filePath, "/profile/lingshui/")) {
            		mmap.put("fileState", "1");
            		mmap.put("filePath", filePath);
            	}else {
            		mmap.put("fileState", "2");
            		mmap.put("filePath", "");
            	}
        	}else if(StrUtil.containsAny(filePath,"\\")){
        		if(StrUtil.split(filePath, "\\").length == 4) {
        			mmap.put("fileState", "0");
            		mmap.put("filePath", Global.getConfig("ruoyi.bigPlatform") + filePath);
        		}else {
        			mmap.put("fileState", "2");
            		mmap.put("filePath", "");
        		}
        	}
    	}else {
    		mmap.put("FileNameOld", "");
    		mmap.put("fileState", "2");
    		mmap.put("filePath", "");
    	}
    	return peopleBadBehaviorPrefix + "/peopleBadBehaviorUpdate";
    }
	
	/**
	 * @Title: personsBadBehaviorSaveAndReportUpdate
	 * @Description: 人员不良行为编辑保存接口(该接口不包含文件上传)
	 * @Author wtj
	 * @DateTime 2020年6月18日 上午11:42:25
	 * @param ppie
	 * @param MaxScores
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personBadBehavior:wsbeditxw")
	@PostMapping("/personsBadBehaviorSaveAndReportUpdate")
    @ResponseBody
    public AjaxResult personsBadBehaviorSaveAndReportUpdate(@Validated PersonalPoorInfoEntity ppie,String MaxScores)
    {
		return toAjax(integrityInformationAddService.updatePeopleBadBehavior(ppie, 1,MaxScores));
    }
	
	/**
	 * @Title: addFileInsertBadUpdate
	 * @Description:人员不良行为编辑保存接口(该接口包含文件上传)
	 * @Author wtj
	 * @DateTime 2020年6月22日 下午4:16:43
	 * @param addFile
	 * @param ppie
	 * @param MaxScores
	 * @return
	 * @throws IOException
	 */
	@RequiresPermissions("integrityInformationAdd:personBadBehavior:wsbeditxw")
	@PostMapping("/addFileInsertBadUpdate")
    @ResponseBody
    public AjaxResult addFileInsertBadUpdate(@RequestParam("addFileInsertBadUpdate") MultipartFile addFile,PersonalPoorInfoEntity ppie,String MaxScores) throws IOException
    {
		// 上传文件路径
    	String filePath = Global.getLSUploadPath();
    	// 上传并返回新文件名称
    	String fileName = FileUploadUtils.upload(filePath, addFile);
    	ppie.setMaterials("|"+fileName+"|"+"人员不良行为记录相关材料_"+ppie.getPersonName()+"_"+ppie.getBehaviorCode()+"."+FileUploadUtils.getExtension(addFile)+"|"+addFile.getSize());
    	ppie.setFileNameOld("人员不良行为记录相关材料_"+ppie.getPersonName()+"_"+ppie.getBehaviorCode()+"."+FileUploadUtils.getExtension(addFile));
    	return AjaxResult.success(integrityInformationAddService.updatePeopleBadBehavior(ppie, 0,MaxScores));
    }
	
	//下面开始审批接口
	/**
	 * @Title: peopleGoodBehaviorApprove
	 * @Description: 跳转到人员良好行为审批
	 * @Author wtj
	 * @DateTime 2020年6月22日 下午4:19:53
	 * @param guid
	 * @param mmap
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personGoodBehavior:ysbapprovalxw")
	@GetMapping("/peopleGoodBehaviorApprove/{guid}")
    public String peopleGoodBehaviorApprove(@PathVariable("guid") String guid,ModelMap mmap)
    {
		IGMIntegrityApplyInfo applyInfo = integrityInformationAddService.selectIGMIntegrityApplyInfoByGuid(guid);
		if(applyInfo == null) {
			throw new LSBusinessException("数据获取不正确，请确认选择的是否正确");
		}
    	mmap.put("applyInfo", applyInfo);
    	StandardEntity se = integrityInformationAddService.selectStandardEntityByGuid(applyInfo.getPersonalWellInfoEntity().getBehaviorCode());
    	applyInfo.getPersonalWellInfoEntity().setStandard(se);
    	if(StrUtil.containsAny(applyInfo.getPersonalWellInfoEntity().getStandard().getPenaltyScores(), ",")) {
    		String[] subStr=StrUtil.split(applyInfo.getPersonalWellInfoEntity().getStandard().getPenaltyScores(), ",");
    		mmap.put("subStr", subStr);
    	}
    	mmap.put("personalWellInfoEntity", applyInfo.getPersonalWellInfoEntity());
    	
    	if(StringUtils.isEmpty(se.getMaxScores()) || se.getMaxScores().equals("0") || se.getMaxScores().equals("0.0")) {
    		se.setMaxScores("无上限");
    	}
    	mmap.put("StandardEntity", se);
    	IGMAuditRecord igmar = integrityInformationAddService.selectIGMAuditRecordByGuidTopOne(applyInfo.getGuid());
    	mmap.put("igmar", igmar);
    	if(StrUtil.split(applyInfo.getPersonalWellInfoEntity().getMaterials(), "|").length == 4) {
    		mmap.put("FileNameOld", StrUtil.split(applyInfo.getPersonalWellInfoEntity().getMaterials(), "|")[2]);
    		String filePath = StrUtil.split(applyInfo.getPersonalWellInfoEntity().getMaterials(), "|")[1];
        	String[] file = StrUtil.split(filePath, "/");
        	//判断是否属于陵水系统上传的文件
        	if(file.length >= 3) {
        		if("profile".equals(file[1]) && "lingshui".equals(file[2]) && StrUtil.containsAny(filePath, "/profile/lingshui/")) {
            		mmap.put("fileState", "1");
            		mmap.put("filePath", filePath);
            	}else {
            		mmap.put("fileState", "2");
            		mmap.put("filePath", "");
            	}
        	}else if(StrUtil.containsAny(filePath,"\\")){
        		if(StrUtil.split(filePath, "\\").length == 4) {
        			mmap.put("fileState", "0");
            		mmap.put("filePath", Global.getConfig("ruoyi.bigPlatform") + filePath);
        		}else {
        			mmap.put("fileState", "2");
            		mmap.put("filePath", "");
        		}
        	}
    	}else {
    		mmap.put("FileNameOld", "");
    		mmap.put("fileState", "2");
    		mmap.put("filePath", "");
    	}
    	return peopleGoodBehaviorPrefix + "/peopleGoodBehaviorApprove";
    }
	
	/**
	 * @Title: peopleGoodBehaviorApprove
	 * @Description: 人员良好行为审批接口
	 * @Author wtj
	 * @DateTime 2020年6月22日 下午5:32:21
	 * @param pwie
	 * @param reasonContent
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personGoodBehavior:ysbapprovalxw")
	@PostMapping("/peopleGoodBehaviorApprove")
    @ResponseBody
    public AjaxResult peopleGoodBehaviorApprove(@Validated PersonalWellInfoEntity pwie,String reasonContent)
    {
		return toAjax(integrityInformationAddService.peopleGoodBehaviorApprove(pwie,reasonContent));
    }
	
	/**
	 * @Title: peopleBadBehaviorApprove
	 * @Description: 跳转到人员不良行为审批
	 * @Author wtj
	 * @DateTime 2020年7月7日 上午9:59:43
	 * @param guid
	 * @param mmap
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personBadBehavior:ysbapprovalxw")
	@GetMapping("/peopleBadBehaviorApprove/{guid}")
    public String peopleBadBehaviorApprove(@PathVariable("guid") String guid,ModelMap mmap)
    {
		IGMIntegrityApplyInfo applyInfo = integrityInformationAddService.selectIGMIntegrityApplyInfoByGuid(guid);
		if(applyInfo == null) {
			throw new LSBusinessException("数据获取不正确，请确认选择的是否正确");
		}
    	mmap.put("applyInfo", applyInfo);
    	StandardEntity se = integrityInformationAddService.selectStandardEntityByGuid(applyInfo.getPersonnalPoorInfoEntity().getBehaviorCode());
    	applyInfo.getPersonnalPoorInfoEntity().setStandard(se);
    	if(StrUtil.containsAny(applyInfo.getPersonnalPoorInfoEntity().getStandard().getPenaltyScores(), ",")) {
    		String[] subStr=StrUtil.split(applyInfo.getPersonnalPoorInfoEntity().getStandard().getPenaltyScores(), ",");
    		mmap.put("subStr", subStr);
    	}
    	mmap.put("personnalPoorInfoEntity", applyInfo.getPersonnalPoorInfoEntity());
    	if(StringUtils.isEmpty(se.getMaxScores()) || se.getMaxScores().equals("0") || se.getMaxScores().equals("0.0")) {
    		se.setMaxScores("无上限");
    	}
    	mmap.put("StandardEntity", se);
    	IGMAuditRecord igmar = integrityInformationAddService.selectIGMAuditRecordByGuidTopOne(applyInfo.getGuid());
    	mmap.put("igmar", igmar);
    	if(StrUtil.split(applyInfo.getPersonnalPoorInfoEntity().getMaterials(), "|").length == 4) {
    		mmap.put("FileNameOld", StrUtil.split(applyInfo.getPersonnalPoorInfoEntity().getMaterials(), "|")[2]);
    		String filePath = StrUtil.split(applyInfo.getPersonnalPoorInfoEntity().getMaterials(), "|")[1];
    		String[] file = StrUtil.split(filePath, "/");
    		//判断是否属于陵水系统上传的文件
        	if(file.length >= 3) {
        		if("profile".equals(file[1]) && "lingshui".equals(file[2]) && StrUtil.containsAny(filePath, "/profile/lingshui/")) {
            		mmap.put("fileState", "1");
            		mmap.put("filePath", filePath);
            	}else {
            		mmap.put("fileState", "2");
            		mmap.put("filePath", "");
            	}
        	}else if(StrUtil.containsAny(filePath,"\\")){
        		if(StrUtil.split(filePath, "\\").length == 4) {
        			mmap.put("fileState", "0");
            		mmap.put("filePath", Global.getConfig("ruoyi.bigPlatform") + filePath);
        		}else {
        			mmap.put("fileState", "2");
            		mmap.put("filePath", "");
        		}
        	}
    	}else {
    		mmap.put("FileNameOld", "");
    		mmap.put("fileState", "2");
    		mmap.put("filePath", "");
    	}
    	return peopleBadBehaviorPrefix + "/peopleBadBehaviorApprove";
    }
	
	/**
	 * @Title: personBadBehaviorApprove
	 * @Description: 人员不良行为审批接口
	 * @Author wtj
	 * @DateTime 2020年7月7日 上午10:00:39
	 * @param ppie
	 * @param reasonContent
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personBadBehavior:ysbapprovalxw")
	@PostMapping("/personBadBehaviorApprove")
    @ResponseBody
    public AjaxResult personBadBehaviorApprove(@Validated PersonalPoorInfoEntity ppie,String reasonContent)
    {
		if(StringUtils.isEmpty(ppie.getGuid()) || StringUtils.isEmpty(ppie.getIGMIntegrityApplyInfoGuid())) {
    		throw new LSBusinessException("数据获取不正确，请确认选择的是否正确");
    	}
		return toAjax(integrityInformationAddService.peopleBadBehaviorApprove(ppie, reasonContent));
    }
	
	//下面开始撤销接口
	/**
	 * @Title: peopleGoodBehaviorUndoAdd
	 * @Description: 跳转到人员良好行为撤销申请页面
	 * @Author wtj
	 * @DateTime 2020年7月7日 上午10:07:22
	 * @param guid
	 * @param mmap
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personGoodBehavior:passcx")
	@GetMapping("/peopleGoodBehaviorUndoAdd/{guid}")
    public String peopleGoodBehaviorUndoAdd(@PathVariable("guid") String guid,ModelMap mmap)
    {
		IGMIntegrityApplyInfo applyInfo = integrityInformationAddService.selectIGMIntegrityApplyInfoByGuid(guid);
		if(applyInfo == null) {
			throw new LSBusinessException("数据获取不正确，请确认选择的是否正确");
		}
    	mmap.put("applyInfo", applyInfo);
    	StandardEntity se = integrityInformationAddService.selectStandardEntityByGuid(applyInfo.getPersonalWellInfoEntity().getBehaviorCode());
    	applyInfo.getPersonalWellInfoEntity().setStandard(se);
    	if(StrUtil.containsAny(applyInfo.getPersonalWellInfoEntity().getStandard().getPenaltyScores(), ",")) {
    		String[] subStr=StrUtil.split(applyInfo.getPersonalWellInfoEntity().getStandard().getPenaltyScores(), ",");
    		mmap.put("subStr", subStr);
    	}
    	mmap.put("personalWellInfoEntity", applyInfo.getPersonalWellInfoEntity());
    	
    	if(StringUtils.isEmpty(se.getMaxScores()) || se.getMaxScores().equals("0") || se.getMaxScores().equals("0.0")) {
    		se.setMaxScores("无上限");
    	}
    	mmap.put("StandardEntity", se);
    	if(StrUtil.split(applyInfo.getPersonalWellInfoEntity().getMaterials(), "|").length == 4) {
    		mmap.put("FileNameOld", StrUtil.split(applyInfo.getPersonalWellInfoEntity().getMaterials(), "|")[2]);
    		String filePath = StrUtil.split(applyInfo.getPersonalWellInfoEntity().getMaterials(), "|")[1];
        	String[] file = StrUtil.split(filePath, "/");
        	//判断是否属于陵水系统上传的文件
        	if(file.length >= 3) {
        		if("profile".equals(file[1]) && "lingshui".equals(file[2]) && StrUtil.containsAny(filePath, "/profile/lingshui/")) {
            		mmap.put("fileState", "1");
            		mmap.put("filePath", filePath);
            	}else {
            		mmap.put("fileState", "2");
            		mmap.put("filePath", "");
            	}
        	}else if(StrUtil.containsAny(filePath,"\\")){
        		if(StrUtil.split(filePath, "\\").length == 4) {
        			mmap.put("fileState", "0");
            		mmap.put("filePath", Global.getConfig("ruoyi.bigPlatform") + filePath);
        		}else {
        			mmap.put("fileState", "2");
            		mmap.put("filePath", "");
        		}
        	}
    	}else {
    		mmap.put("FileNameOld", "");
    		mmap.put("fileState", "2");
    		mmap.put("filePath", "");
    	}
    	return peopleGoodBehaviorPrefix + "/peopleGoodBehaviorUndo";
    }
	
	/**
	 * @Title: peopleGoodBehaviorUndoSaveAndReport
	 * @Description: 人员良好行为撤销申请的保存，上报
	 * @Author wtj
	 * @DateTime 2020年7月7日 上午10:38:04
	 * @param pwie
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personGoodBehavior:passcx")
	@PostMapping("/peopleGoodBehaviorUndoSaveAndReport")
    @ResponseBody
    public AjaxResult peopleGoodBehaviorUndoSaveAndReport(@Validated PersonalWellInfoEntity pwie)
    {
    	if(StringUtils.isEmpty(pwie.getGuid()) || StringUtils.isEmpty(pwie.getIGMIntegrityApplyInfoGuid())) {
    		throw new LSBusinessException("数据获取不正确，请确认选择的是否正确");
    	}
    	return toAjax(integrityInformationAddService.peopleGoodBehaviorUndoSaveAndReport(pwie));
    }
	
	/**
	 * @Title: editPeopleGoodBehaviorUndo
	 * @Description: 跳转到人员良好行为撤销申请的编辑页面
	 * @Author wtj
	 * @DateTime 2020年7月7日 上午10:46:37
	 * @param guid
	 * @param mmap
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personGoodBehavior:wsbeditcx")
	@GetMapping("/editPeopleGoodBehaviorUndo/{guid}")
    public String editPeopleGoodBehaviorUndo(@PathVariable("guid") String guid,ModelMap mmap)
    {
		IGMIntegrityApplyInfo applyInfo = integrityInformationAddService.selectIGMIntegrityApplyInfoByGuid(guid);
		if(applyInfo == null) {
			throw new LSBusinessException("数据获取不正确，请确认选择的是否正确");
		}
    	mmap.put("applyInfo", applyInfo);
    	StandardEntity se = integrityInformationAddService.selectStandardEntityByGuid(applyInfo.getPersonalWellInfoEntity().getBehaviorCode());
    	applyInfo.getPersonalWellInfoEntity().setStandard(se);
    	if(StrUtil.containsAny(applyInfo.getPersonalWellInfoEntity().getStandard().getPenaltyScores(), ",")) {
    		String[] subStr=StrUtil.split(applyInfo.getPersonalWellInfoEntity().getStandard().getPenaltyScores(), ",");
    		mmap.put("subStr", subStr);
    	}
    	mmap.put("personalWellInfoEntity", applyInfo.getPersonalWellInfoEntity());
    	
    	if(StringUtils.isEmpty(se.getMaxScores()) || se.getMaxScores().equals("0") || se.getMaxScores().equals("0.0")) {
    		se.setMaxScores("无上限");
    	}
    	mmap.put("StandardEntity", se);
    	if(StrUtil.split(applyInfo.getPersonalWellInfoEntity().getMaterials(), "|").length == 4) {
    		mmap.put("FileNameOld", StrUtil.split(applyInfo.getPersonalWellInfoEntity().getMaterials(), "|")[2]);
    		String filePath = StrUtil.split(applyInfo.getPersonalWellInfoEntity().getMaterials(), "|")[1];
        	String[] file = StrUtil.split(filePath, "/");
        	//判断是否属于陵水系统上传的文件
        	if(file.length >= 3) {
        		if("profile".equals(file[1]) && "lingshui".equals(file[2]) && StrUtil.containsAny(filePath, "/profile/lingshui/")) {
            		mmap.put("fileState", "1");
            		mmap.put("filePath", filePath);
            	}else {
            		mmap.put("fileState", "2");
            		mmap.put("filePath", "");
            	}
        	}else if(StrUtil.containsAny(filePath,"\\")){
        		if(StrUtil.split(filePath, "\\").length == 4) {
        			mmap.put("fileState", "0");
            		mmap.put("filePath", Global.getConfig("ruoyi.bigPlatform") + filePath);
        		}else {
        			mmap.put("fileState", "2");
            		mmap.put("filePath", "");
        		}
        	}
    	}else {
    		mmap.put("FileNameOld", "");
    		mmap.put("fileState", "2");
    		mmap.put("filePath", "");
    	}
    	return peopleGoodBehaviorPrefix + "/peopleGoodBehaviorUndoUpdate";
    }
	
	/**
	 * @Title: peopleGoodBehaviorUndoSaveAndReportUpdate
	 * @Description: 人员良好行为撤销申请编辑保存接口
	 * @Author wtj
	 * @DateTime 2020年7月7日 上午11:35:22
	 * @param pwie
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personGoodBehavior:wsbeditcx")
	@PostMapping("/peopleGoodBehaviorUndoSaveAndReportUpdate")
    @ResponseBody
    public AjaxResult peopleGoodBehaviorUndoSaveAndReportUpdate(@Validated PersonalWellInfoEntity pwie)
    {
    	if(StringUtils.isEmpty(pwie.getGuid()) || StringUtils.isEmpty(pwie.getIGMIntegrityApplyInfoGuid())) {
    		throw new LSBusinessException("数据获取不正确，请确认选择的是否正确");
    	}
    	return toAjax(integrityInformationAddService.peopleGoodBehaviorUndoSaveAndReportUpdate(pwie));
    }
	
	/**
	 * @Title: peopleGoodBehaviorUndoApprove
	 * @Description: 跳转到人员良好行为撤销审批页面
	 * @Author wtj
	 * @DateTime 2020年7月7日 下午2:11:21
	 * @param guid
	 * @param mmap
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personGoodBehavior:ysbapprovalcx")
	@GetMapping("/peopleGoodBehaviorUndoApprove/{guid}")
    public String peopleGoodBehaviorUndoApprove(@PathVariable("guid") String guid,ModelMap mmap)
    {
		IGMIntegrityApplyInfo applyInfo = integrityInformationAddService.selectIGMIntegrityApplyInfoByGuid(guid);
		if(applyInfo == null) {
			throw new LSBusinessException("数据获取不正确，请确认选择的是否正确");
		}
    	mmap.put("applyInfo", applyInfo);
    	StandardEntity se = integrityInformationAddService.selectStandardEntityByGuid(applyInfo.getPersonalWellInfoEntity().getBehaviorCode());
    	applyInfo.getPersonalWellInfoEntity().setStandard(se);
    	if(StrUtil.containsAny(applyInfo.getPersonalWellInfoEntity().getStandard().getPenaltyScores(), ",")) {
    		String[] subStr=StrUtil.split(applyInfo.getPersonalWellInfoEntity().getStandard().getPenaltyScores(), ",");
    		mmap.put("subStr", subStr);
    	}
    	mmap.put("personalWellInfoEntity", applyInfo.getPersonalWellInfoEntity());
    	
    	if(StringUtils.isEmpty(se.getMaxScores()) || se.getMaxScores().equals("0") || se.getMaxScores().equals("0.0")) {
    		se.setMaxScores("无上限");
    	}
    	mmap.put("StandardEntity", se);
    	if(StrUtil.split(applyInfo.getPersonalWellInfoEntity().getMaterials(), "|").length == 4) {
    		mmap.put("FileNameOld", StrUtil.split(applyInfo.getPersonalWellInfoEntity().getMaterials(), "|")[2]);
    		String filePath = StrUtil.split(applyInfo.getPersonalWellInfoEntity().getMaterials(), "|")[1];
        	String[] file = StrUtil.split(filePath, "/");
        	//判断是否属于陵水系统上传的文件
        	if(file.length >= 3) {
        		if("profile".equals(file[1]) && "lingshui".equals(file[2]) && StrUtil.containsAny(filePath, "/profile/lingshui/")) {
            		mmap.put("fileState", "1");
            		mmap.put("filePath", filePath);
            	}else {
            		mmap.put("fileState", "2");
            		mmap.put("filePath", "");
            	}
        	}else if(StrUtil.containsAny(filePath,"\\")){
        		if(StrUtil.split(filePath, "\\").length == 4) {
        			mmap.put("fileState", "0");
            		mmap.put("filePath", Global.getConfig("ruoyi.bigPlatform") + filePath);
        		}else {
        			mmap.put("fileState", "2");
            		mmap.put("filePath", "");
        		}
        	}
    	}else {
    		mmap.put("FileNameOld", "");
    		mmap.put("fileState", "2");
    		mmap.put("filePath", "");
    	}
    	return peopleGoodBehaviorPrefix + "/peopleGoodBehaviorUndoApprove";
    }
	
	/**
	 * @Title: peopleGoodBehaviorUndoApprove
	 * @Description: 人员良好行为撤销审批
	 * @Author wtj
	 * @DateTime 2020年7月13日 下午2:31:50
	 * @param pwie
	 * @param reasonContent
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personGoodBehavior:ysbapprovalcx")
	@PostMapping("/peopleGoodBehaviorUndoApprove")
    @ResponseBody
    public AjaxResult peopleGoodBehaviorUndoApprove(@Validated PersonalWellInfoEntity pwie,String reasonContent)
    {
		if(pwie==null || StringUtils.isEmpty(pwie.getGuid()) || StringUtils.isEmpty(pwie.getIGMIntegrityApplyInfoGuid())) {
    		throw new LSBusinessException("数据获取不正确，请确认选择的是否正确");
    	}
    	return toAjax(integrityInformationAddService.peopleGoodBehaviorUndoApprove(pwie, reasonContent));
    }
	
	/**
	 * @Title: peopleBadBehaviorUndoAdd
	 * @Description: 跳转到人员不良行为撤销申请页面
	 * @Author wtj
	 * @DateTime 2020年7月13日 下午3:31:28
	 * @param guid
	 * @param mmap
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personBadBehavior:passcx")
	@GetMapping("/peopleBadBehaviorUndoAdd/{guid}")
    public String peopleBadBehaviorUndoAdd(@PathVariable("guid") String guid,ModelMap mmap)
    {
		IGMIntegrityApplyInfo applyInfo = integrityInformationAddService.selectIGMIntegrityApplyInfoByGuid(guid);
		if(applyInfo == null) {
			throw new LSBusinessException("数据获取不正确，请确认选择的是否正确");
		}
    	mmap.put("applyInfo", applyInfo);
    	StandardEntity se = integrityInformationAddService.selectStandardEntityByGuid(applyInfo.getPersonnalPoorInfoEntity().getBehaviorCode());
    	applyInfo.getPersonnalPoorInfoEntity().setStandard(se);
    	if(StrUtil.containsAny(applyInfo.getPersonnalPoorInfoEntity().getStandard().getPenaltyScores(), ",")) {
    		String[] subStr=StrUtil.split(applyInfo.getPersonnalPoorInfoEntity().getStandard().getPenaltyScores(), ",");
    		mmap.put("subStr", subStr);
    	}
    	mmap.put("personnalPoorInfoEntity", applyInfo.getPersonnalPoorInfoEntity());
    	if(StringUtils.isEmpty(se.getMaxScores()) || se.getMaxScores().equals("0") || se.getMaxScores().equals("0.0")) {
    		se.setMaxScores("无上限");
    	}
    	mmap.put("StandardEntity", se);
    	if(StrUtil.split(applyInfo.getPersonnalPoorInfoEntity().getMaterials(), "|").length == 4) {
    		mmap.put("FileNameOld", StrUtil.split(applyInfo.getPersonnalPoorInfoEntity().getMaterials(), "|")[2]);
    		String filePath = StrUtil.split(applyInfo.getPersonnalPoorInfoEntity().getMaterials(), "|")[1];
    		String[] file = StrUtil.split(filePath, "/");
    		//判断是否属于陵水系统上传的文件
        	if(file.length >= 3) {
        		if("profile".equals(file[1]) && "lingshui".equals(file[2]) && StrUtil.containsAny(filePath, "/profile/lingshui/")) {
            		mmap.put("fileState", "1");
            		mmap.put("filePath", filePath);
            	}else {
            		mmap.put("fileState", "2");
            		mmap.put("filePath", "");
            	}
        	}else if(StrUtil.containsAny(filePath,"\\")){
        		if(StrUtil.split(filePath, "\\").length == 4) {
        			mmap.put("fileState", "0");
            		mmap.put("filePath", Global.getConfig("ruoyi.bigPlatform") + filePath);
        		}else {
        			mmap.put("fileState", "2");
            		mmap.put("filePath", "");
        		}
        	}
    	}else {
    		mmap.put("FileNameOld", "");
    		mmap.put("fileState", "2");
    		mmap.put("filePath", "");
    	}
    	return peopleBadBehaviorPrefix + "/peopleBadBehaviorUndo";
    }
	
	/**
	 * @Title: peopleBadBehaviorUndoSaveAndReport
	 * @Description: 人员不良行为撤销申请的保存，上报
	 * @Author wtj
	 * @DateTime 2020年7月13日 下午4:01:19
	 * @param ppie
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personBadBehavior:passcx")
	@PostMapping("/peopleBadBehaviorUndoSaveAndReport")
    @ResponseBody
    public AjaxResult peopleBadBehaviorUndoSaveAndReport(@Validated PersonalPoorInfoEntity ppie)
    {
		if(StringUtils.isEmpty(ppie.getGuid()) || StringUtils.isEmpty(ppie.getIGMIntegrityApplyInfoGuid())) {
    		throw new LSBusinessException("数据获取不正确，请确认选择的是否正确");
    	}
		return toAjax(integrityInformationAddService.peopleBadBehaviorUndoSaveAndReport(ppie));
    }
	
	/**
	 * @Title: editPeopleBadBehaviorUndo
	 * @Description: 跳转到人员不良行为撤销申请的编辑页面
	 * @Author wtj
	 * @DateTime 2020年7月13日 下午5:47:30
	 * @param guid
	 * @param mmap
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personBadBehavior:wsbeditcx")
	@GetMapping("/editPeopleBadBehaviorUndo/{guid}")
    public String editPeopleBadBehaviorUndo(@PathVariable("guid") String guid,ModelMap mmap)
    {
		IGMIntegrityApplyInfo applyInfo = integrityInformationAddService.selectIGMIntegrityApplyInfoByGuid(guid);
		if(applyInfo == null) {
			throw new LSBusinessException("数据获取不正确，请确认选择的是否正确");
		}
    	mmap.put("applyInfo", applyInfo);
    	StandardEntity se = integrityInformationAddService.selectStandardEntityByGuid(applyInfo.getPersonnalPoorInfoEntity().getBehaviorCode());
    	applyInfo.getPersonnalPoorInfoEntity().setStandard(se);
    	if(StrUtil.containsAny(applyInfo.getPersonnalPoorInfoEntity().getStandard().getPenaltyScores(), ",")) {
    		String[] subStr=StrUtil.split(applyInfo.getPersonnalPoorInfoEntity().getStandard().getPenaltyScores(), ",");
    		mmap.put("subStr", subStr);
    	}
    	mmap.put("personnalPoorInfoEntity", applyInfo.getPersonnalPoorInfoEntity());
    	if(StringUtils.isEmpty(se.getMaxScores()) || se.getMaxScores().equals("0") || se.getMaxScores().equals("0.0")) {
    		se.setMaxScores("无上限");
    	}
    	mmap.put("StandardEntity", se);
    	if(StrUtil.split(applyInfo.getPersonnalPoorInfoEntity().getMaterials(), "|").length == 4) {
    		mmap.put("FileNameOld", StrUtil.split(applyInfo.getPersonnalPoorInfoEntity().getMaterials(), "|")[2]);
    		String filePath = StrUtil.split(applyInfo.getPersonnalPoorInfoEntity().getMaterials(), "|")[1];
    		String[] file = StrUtil.split(filePath, "/");
    		//判断是否属于陵水系统上传的文件
        	if(file.length >= 3) {
        		if("profile".equals(file[1]) && "lingshui".equals(file[2]) && StrUtil.containsAny(filePath, "/profile/lingshui/")) {
            		mmap.put("fileState", "1");
            		mmap.put("filePath", filePath);
            	}else {
            		mmap.put("fileState", "2");
            		mmap.put("filePath", "");
            	}
        	}else if(StrUtil.containsAny(filePath,"\\")){
        		if(StrUtil.split(filePath, "\\").length == 4) {
        			mmap.put("fileState", "0");
            		mmap.put("filePath", Global.getConfig("ruoyi.bigPlatform") + filePath);
        		}else {
        			mmap.put("fileState", "2");
            		mmap.put("filePath", "");
        		}
        	}
    	}else {
    		mmap.put("FileNameOld", "");
    		mmap.put("fileState", "2");
    		mmap.put("filePath", "");
    	}
    	return peopleBadBehaviorPrefix + "/peopleBadBehaviorUndoUpdate";
    }
	
	/**
	 * @Title: peopleBadBehaviorUndoSaveAndReportUpdate
	 * @Description: 人员不良行为撤销申请编辑保存接口
	 * @Author wtj
	 * @DateTime 2020年7月15日 上午9:10:02
	 * @param ppie
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personBadBehavior:wsbeditcx")
	@PostMapping("/peopleBadBehaviorUndoSaveAndReportUpdate")
    @ResponseBody
    public AjaxResult peopleBadBehaviorUndoSaveAndReportUpdate(@Validated PersonalPoorInfoEntity ppie)
    {
		if(StringUtils.isEmpty(ppie.getGuid()) || StringUtils.isEmpty(ppie.getIGMIntegrityApplyInfoGuid())) {
    		throw new LSBusinessException("数据获取不正确，请确认选择的是否正确");
    	}
		return toAjax(integrityInformationAddService.peopleBadBehaviorUndoSaveAndReportUpdate(ppie));
    }
	
	/**
	 * @Title: peopleBadBehaviorUndoApprove
	 * @Description: 跳转到人员不良行为撤销审批页面
	 * @Author wtj
	 * @DateTime 2020年7月15日 上午9:26:51
	 * @param guid
	 * @param mmap
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personBadBehavior:ysbapprovalcx")
	@GetMapping("/peopleBadBehaviorUndoApprove/{guid}")
    public String peopleBadBehaviorUndoApprove(@PathVariable("guid") String guid,ModelMap mmap)
    {
		IGMIntegrityApplyInfo applyInfo = integrityInformationAddService.selectIGMIntegrityApplyInfoByGuid(guid);
		if(applyInfo == null) {
			throw new LSBusinessException("数据获取不正确，请确认选择的是否正确");
		}
    	mmap.put("applyInfo", applyInfo);
    	StandardEntity se = integrityInformationAddService.selectStandardEntityByGuid(applyInfo.getPersonnalPoorInfoEntity().getBehaviorCode());
    	applyInfo.getPersonnalPoorInfoEntity().setStandard(se);
    	if(StrUtil.containsAny(applyInfo.getPersonnalPoorInfoEntity().getStandard().getPenaltyScores(), ",")) {
    		String[] subStr=StrUtil.split(applyInfo.getPersonnalPoorInfoEntity().getStandard().getPenaltyScores(), ",");
    		mmap.put("subStr", subStr);
    	}
    	mmap.put("personnalPoorInfoEntity", applyInfo.getPersonnalPoorInfoEntity());
    	if(StringUtils.isEmpty(se.getMaxScores()) || se.getMaxScores().equals("0") || se.getMaxScores().equals("0.0")) {
    		se.setMaxScores("无上限");
    	}
    	mmap.put("StandardEntity", se);
    	if(StrUtil.split(applyInfo.getPersonnalPoorInfoEntity().getMaterials(), "|").length == 4) {
    		mmap.put("FileNameOld", StrUtil.split(applyInfo.getPersonnalPoorInfoEntity().getMaterials(), "|")[2]);
    		String filePath = StrUtil.split(applyInfo.getPersonnalPoorInfoEntity().getMaterials(), "|")[1];
    		String[] file = StrUtil.split(filePath, "/");
    		//判断是否属于陵水系统上传的文件
        	if(file.length >= 3) {
        		if("profile".equals(file[1]) && "lingshui".equals(file[2]) && StrUtil.containsAny(filePath, "/profile/lingshui/")) {
            		mmap.put("fileState", "1");
            		mmap.put("filePath", filePath);
            	}else {
            		mmap.put("fileState", "2");
            		mmap.put("filePath", "");
            	}
        	}else if(StrUtil.containsAny(filePath,"\\")){
        		if(StrUtil.split(filePath, "\\").length == 4) {
        			mmap.put("fileState", "0");
            		mmap.put("filePath", Global.getConfig("ruoyi.bigPlatform") + filePath);
        		}else {
        			mmap.put("fileState", "2");
            		mmap.put("filePath", "");
        		}
        	}
    	}else {
    		mmap.put("FileNameOld", "");
    		mmap.put("fileState", "2");
    		mmap.put("filePath", "");
    	}
    	return peopleBadBehaviorPrefix + "/peopleBadBehaviorUndoApprove";
    }
	
	/**
	 * @Title: peopleBadBehaviorUndoApprove
	 * @Description: 人员不良行为撤销审批
	 * @Author wtj
	 * @DateTime 2020年7月15日 上午9:28:47
	 * @param ppie
	 * @param reasonContent
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personBadBehavior:ysbapprovalcx")
	@PostMapping("/peopleBadBehaviorUndoApprove")
    @ResponseBody
    public AjaxResult peopleBadBehaviorUndoApprove(@Validated PersonalPoorInfoEntity ppie,String reasonContent)
    {
		if(ppie==null || StringUtils.isEmpty(ppie.getGuid()) || StringUtils.isEmpty(ppie.getIGMIntegrityApplyInfoGuid())) {
    		throw new LSBusinessException("数据获取不正确，请确认选择的是否正确");
    	}
    	return toAjax(integrityInformationAddService.peopleBadBehaviorUndoApprove(ppie, reasonContent));
    }
	
	//下面是整改
	/**
	 * @Title: peopleGoodBehaviorRect
	 * @Description: 跳到人员良好行为整改页面
	 * @Author wtj
	 * @DateTime 2020年7月16日 下午5:42:31
	 * @param guid
	 * @param mmap
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personGoodBehavior:returnzgdj")
	@GetMapping("/peopleGoodBehaviorRect/{guid}")
    public String peopleGoodBehaviorRect(@PathVariable("guid") String guid,ModelMap mmap)
    {
		IGMIntegrityApplyInfo applyInfo = integrityInformationAddService.selectIGMIntegrityApplyInfoByGuid(guid);
		if(applyInfo == null) {
			throw new LSBusinessException("数据获取不正确，请确认选择的是否正确");
		}
		mmap.put("applyInfo", applyInfo);
    	StandardEntity se = integrityInformationAddService.selectStandardEntityByGuid(applyInfo.getPersonalWellInfoEntity().getBehaviorCode());
    	applyInfo.getPersonalWellInfoEntity().setStandard(se);
    	if(StrUtil.containsAny(applyInfo.getPersonalWellInfoEntity().getStandard().getPenaltyScores(), ",")) {
    		String[] subStr=StrUtil.split(applyInfo.getPersonalWellInfoEntity().getStandard().getPenaltyScores(), ",");
    		mmap.put("subStr", subStr);
    	}
    	mmap.put("personalWellInfoEntity", applyInfo.getPersonalWellInfoEntity());
    	
    	if(StringUtils.isEmpty(se.getMaxScores()) || se.getMaxScores().equals("0") || se.getMaxScores().equals("0.0")) {
    		se.setMaxScores("无上限");
    	}
    	mmap.put("StandardEntity", se);
    	IGMAuditRecord igmar = integrityInformationAddService.selectIGMAuditRecordByGuidTopOne(applyInfo.getGuid());
    	mmap.put("igmar", igmar);
    	if(StrUtil.split(applyInfo.getPersonalWellInfoEntity().getMaterials(), "|").length == 4) {
    		mmap.put("FileNameOld", StrUtil.split(applyInfo.getPersonalWellInfoEntity().getMaterials(), "|")[2]);
    		String filePath = StrUtil.split(applyInfo.getPersonalWellInfoEntity().getMaterials(), "|")[1];
        	String[] file = StrUtil.split(filePath, "/");
        	//判断是否属于陵水系统上传的文件
        	if(file.length >= 3) {
        		if("profile".equals(file[1]) && "lingshui".equals(file[2]) && StrUtil.containsAny(filePath, "/profile/lingshui/")) {
            		mmap.put("fileState", "1");
            		mmap.put("filePath", filePath);
            	}else {
            		mmap.put("fileState", "2");
            		mmap.put("filePath", "");
            	}
        	}else if(StrUtil.containsAny(filePath,"\\")){
        		if(StrUtil.split(filePath, "\\").length == 4) {
        			mmap.put("fileState", "0");
            		mmap.put("filePath", Global.getConfig("ruoyi.bigPlatform") + filePath);
        		}else {
        			mmap.put("fileState", "2");
            		mmap.put("filePath", "");
        		}
        	}
    	}else {
    		mmap.put("FileNameOld", "");
    		mmap.put("fileState", "2");
    		mmap.put("filePath", "");
    	}
    	return peopleGoodBehaviorPrefix + "/peopleGoodBehaviorRect";
    }
	
	/**
	 * @Title: peopleBadBehaviorRect
	 * @Description: 跳到人员不良行为整改页面
	 * @Author wtj
	 * @DateTime 2020年7月21日 上午11:52:55
	 * @param guid
	 * @param mmap
	 * @return
	 */
	@RequiresPermissions("integrityInformationAdd:personBadBehavior:returnzgdj")
	@GetMapping("/peopleBadBehaviorRect/{guid}")
    public String peopleBadBehaviorRect(@PathVariable("guid") String guid,ModelMap mmap)
    {
		IGMIntegrityApplyInfo applyInfo = integrityInformationAddService.selectIGMIntegrityApplyInfoByGuid(guid);
		if(applyInfo == null) {
			throw new LSBusinessException("数据获取不正确，请确认选择的是否正确");
		}
		mmap.put("applyInfo", applyInfo);
    	StandardEntity se = integrityInformationAddService.selectStandardEntityByGuid(applyInfo.getPersonnalPoorInfoEntity().getBehaviorCode());
    	applyInfo.getPersonnalPoorInfoEntity().setStandard(se);
    	if(StrUtil.containsAny(applyInfo.getPersonnalPoorInfoEntity().getStandard().getPenaltyScores(), ",")) {
    		String[] subStr=StrUtil.split(applyInfo.getPersonnalPoorInfoEntity().getStandard().getPenaltyScores(), ",");
    		mmap.put("subStr", subStr);
    	}
    	mmap.put("personnalPoorInfoEntity", applyInfo.getPersonnalPoorInfoEntity());
    	if(StringUtils.isEmpty(se.getMaxScores()) || se.getMaxScores().equals("0") || se.getMaxScores().equals("0.0")) {
    		se.setMaxScores("无上限");
    	}
    	mmap.put("StandardEntity", se);
    	IGMAuditRecord igmar = integrityInformationAddService.selectIGMAuditRecordByGuidTopOne(applyInfo.getGuid());
    	mmap.put("igmar", igmar);
    	if(StrUtil.split(applyInfo.getPersonnalPoorInfoEntity().getMaterials(), "|").length == 4) {
    		mmap.put("FileNameOld", StrUtil.split(applyInfo.getPersonnalPoorInfoEntity().getMaterials(), "|")[2]);
    		String filePath = StrUtil.split(applyInfo.getPersonnalPoorInfoEntity().getMaterials(), "|")[1];
    		String[] file = StrUtil.split(filePath, "/");
    		//判断是否属于陵水系统上传的文件
        	if(file.length >= 3) {
        		if("profile".equals(file[1]) && "lingshui".equals(file[2]) && StrUtil.containsAny(filePath, "/profile/lingshui/")) {
            		mmap.put("fileState", "1");
            		mmap.put("filePath", filePath);
            	}else {
            		mmap.put("fileState", "2");
            		mmap.put("filePath", "");
            	}
        	}else if(StrUtil.containsAny(filePath,"\\")){
        		if(StrUtil.split(filePath, "\\").length == 4) {
        			mmap.put("fileState", "0");
            		mmap.put("filePath", Global.getConfig("ruoyi.bigPlatform") + filePath);
        		}else {
        			mmap.put("fileState", "2");
            		mmap.put("filePath", "");
        		}
        	}
    	}else {
    		mmap.put("FileNameOld", "");
    		mmap.put("fileState", "2");
    		mmap.put("filePath", "");
    	}
    	return peopleBadBehaviorPrefix + "/peopleBadBehaviorRect";
    }
	
	//下面是详情
	/**
	 * @Title: peopleGoodBehaviorDetail
	 * @Description: 人员良好行为的详情
	 * @Author wtj
	 * @DateTime 2020年7月21日 下午12:00:08
	 * @param guid
	 * @param mmap
	 * @return
	 */
	@RequiresPermissions(value={"integrityInformationAdd:personGoodBehavior:ysbdetail", "integrityInformationAdd:personGoodBehavior:passdetai", "integrityInformationAdd:personGoodBehavior:returndetai"}, logical=Logical.OR)
	@GetMapping("/peopleGoodBehaviorDetail/{guid}")
    public String peopleGoodBehaviorDetail(@PathVariable("guid") String guid,ModelMap mmap)
    {
		IGMIntegrityApplyInfo applyInfo = integrityInformationAddService.selectIGMIntegrityApplyInfoByGuid(guid);
		if(applyInfo == null) {
			throw new LSBusinessException("数据获取不正确，请确认选择的是否正确");
		}
    	mmap.put("applyInfo", applyInfo);
    	StandardEntity se = integrityInformationAddService.selectStandardEntityByGuid(applyInfo.getPersonalWellInfoEntity().getBehaviorCode());
    	applyInfo.getPersonalWellInfoEntity().setStandard(se);
    	if(StrUtil.containsAny(applyInfo.getPersonalWellInfoEntity().getStandard().getPenaltyScores(), ",")) {
    		String[] subStr=StrUtil.split(applyInfo.getPersonalWellInfoEntity().getStandard().getPenaltyScores(), ",");
    		mmap.put("subStr", subStr);
    	}
    	mmap.put("personalWellInfoEntity", applyInfo.getPersonalWellInfoEntity());
    	
    	if(StringUtils.isEmpty(se.getMaxScores()) || se.getMaxScores().equals("0") || se.getMaxScores().equals("0.0")) {
    		se.setMaxScores("无上限");
    	}
    	mmap.put("StandardEntity", se);
    	if("审核通过".equals(applyInfo.getState().trim()) || "审核退回".equals(applyInfo.getState().trim())) {
    		IGMAuditRecord igmar = integrityInformationAddService.selectIGMAuditRecordByGuidTopOne(applyInfo.getGuid());
        	mmap.put("igmar", igmar);
    	}
    	if(StrUtil.split(applyInfo.getPersonalWellInfoEntity().getMaterials(), "|").length == 4) {
    		mmap.put("FileNameOld", StrUtil.split(applyInfo.getPersonalWellInfoEntity().getMaterials(), "|")[2]);
    		String filePath = StrUtil.split(applyInfo.getPersonalWellInfoEntity().getMaterials(), "|")[1];
        	String[] file = StrUtil.split(filePath, "/");
        	//判断是否属于陵水系统上传的文件
        	if(file.length >= 3) {
        		if("profile".equals(file[1]) && "lingshui".equals(file[2]) && StrUtil.containsAny(filePath, "/profile/lingshui/")) {
            		mmap.put("fileState", "1");
            		mmap.put("filePath", filePath);
            	}else {
            		mmap.put("fileState", "2");
            		mmap.put("filePath", "");
            	}
        	}else if(StrUtil.containsAny(filePath,"\\")){
        		if(StrUtil.split(filePath, "\\").length == 4) {
        			mmap.put("fileState", "0");
            		mmap.put("filePath", Global.getConfig("ruoyi.bigPlatform") + filePath);
        		}else {
        			mmap.put("fileState", "2");
            		mmap.put("filePath", "");
        		}
        	}
    	}else {
    		mmap.put("FileNameOld", "");
    		mmap.put("fileState", "2");
    		mmap.put("filePath", "");
    	}
    	return peopleGoodBehaviorPrefix + "/peopleGoodBehaviorDetail";
    }
	
	/**
	 * @Title: peopleBadBehaviorDetail
	 * @Description: 人员不良行为的详情
	 * @Author wtj
	 * @DateTime 2020年7月21日 下午12:05:06
	 * @param guid
	 * @param mmap
	 * @return
	 */
	@RequiresPermissions(value={"integrityInformationAdd:personBadBehavior:ysbdetail", "integrityInformationAdd:personBadBehavior:passdetai", "integrityInformationAdd:personBadBehavior:returndetai"}, logical=Logical.OR)
	@GetMapping("/peopleBadBehaviorDetail/{guid}")
    public String peopleBadBehaviorDetail(@PathVariable("guid") String guid,ModelMap mmap)
    {
		IGMIntegrityApplyInfo applyInfo = integrityInformationAddService.selectIGMIntegrityApplyInfoByGuid(guid);
		if(applyInfo == null) {
			throw new LSBusinessException("数据获取不正确，请确认选择的是否正确");
		}
    	mmap.put("applyInfo", applyInfo);
    	StandardEntity se = integrityInformationAddService.selectStandardEntityByGuid(applyInfo.getPersonnalPoorInfoEntity().getBehaviorCode());
    	applyInfo.getPersonnalPoorInfoEntity().setStandard(se);
    	if(StrUtil.containsAny(applyInfo.getPersonnalPoorInfoEntity().getStandard().getPenaltyScores(), ",")) {
    		String[] subStr=StrUtil.split(applyInfo.getPersonnalPoorInfoEntity().getStandard().getPenaltyScores(), ",");
    		mmap.put("subStr", subStr);
    	}
    	mmap.put("personnalPoorInfoEntity", applyInfo.getPersonnalPoorInfoEntity());
    	if(StringUtils.isEmpty(se.getMaxScores()) || se.getMaxScores().equals("0") || se.getMaxScores().equals("0.0")) {
    		se.setMaxScores("无上限");
    	}
    	mmap.put("StandardEntity", se);
    	if("审核通过".equals(applyInfo.getState().trim()) || "审核退回".equals(applyInfo.getState().trim())) {
    		IGMAuditRecord igmar = integrityInformationAddService.selectIGMAuditRecordByGuidTopOne(applyInfo.getGuid());
        	mmap.put("igmar", igmar);
    	}
    	if(StrUtil.split(applyInfo.getPersonnalPoorInfoEntity().getMaterials(), "|").length == 4) {
    		mmap.put("FileNameOld", StrUtil.split(applyInfo.getPersonnalPoorInfoEntity().getMaterials(), "|")[2]);
    		String filePath = StrUtil.split(applyInfo.getPersonnalPoorInfoEntity().getMaterials(), "|")[1];
    		String[] file = StrUtil.split(filePath, "/");
    		//判断是否属于陵水系统上传的文件
        	if(file.length >= 3) {
        		if("profile".equals(file[1]) && "lingshui".equals(file[2]) && StrUtil.containsAny(filePath, "/profile/lingshui/")) {
            		mmap.put("fileState", "1");
            		mmap.put("filePath", filePath);
            	}else {
            		mmap.put("fileState", "2");
            		mmap.put("filePath", "");
            	}
        	}else if(StrUtil.containsAny(filePath,"\\")){
        		if(StrUtil.split(filePath, "\\").length == 4) {
        			mmap.put("fileState", "0");
            		mmap.put("filePath", Global.getConfig("ruoyi.bigPlatform") + filePath);
        		}else {
        			mmap.put("fileState", "2");
            		mmap.put("filePath", "");
        		}
        	}
    	}else {
    		mmap.put("FileNameOld", "");
    		mmap.put("fileState", "2");
    		mmap.put("filePath", "");
    	}
    	return peopleBadBehaviorPrefix + "/peopleBadBehaviorDetail";
    }
}
